import pygame


class cApp:
	def __init__(self,new_gears):
		#new_gears.makeWindow()
		self.gears=new_gears
	def main(self):
		if not(self.gears.screenStack[-1].gears is self.gears):
			print '!'
			self.gears.screenStack[-1].set_gears(self.gears)
		self.gears.screenStack[-1].activate()
		while len(self.gears.screenStack)>0 :
			#print '0'
			self.gears.screenStack[-1].do()
		print 'ciao'